﻿namespace WMS6.SQLServerDAL
{
    using System;
    using System.Data;
    using WMS6.Common;
    using WMS6.DataEntity;
    using WMS6.DBUtility;
    using WMS6.IDAL;

    public class PrintReport4AXDA : IPrintReport4AXDA
    {
        public DataSet GetPrintExpressDelivery(string orderID, PrintReportsInfo tempprintReportsInfo)
        {
            string sql = PublicMethod.GetInstance().GetPrintReportSQL(tempprintReportsInfo.OwnerID + "_AXPrintExpressDelivery");
            if (string.IsNullOrEmpty(sql))
            {
                sql = PublicMethod.GetInstance().GetPrintReportSQL("AXPrintExpressDelivery");
            }
            sql = sql.Replace("@_@", tempprintReportsInfo.WhLoignID).Replace("@ORDER_ID", "'" + orderID + "'").ToString();
            return DBHelper.ExecuteDataSet(CommandType.Text, sql);
        }

        public DataSet GetPrintHandoverNote(string orderID, PrintReportsInfo tempprintReportsInfo)
        {
            string sql = PublicMethod.GetInstance().GetPrintReportSQL(tempprintReportsInfo.OwnerID + "_AXPrintHandoverNote");
            if (string.IsNullOrEmpty(sql))
            {
                sql = PublicMethod.GetInstance().GetPrintReportSQL("AXPrintHandoverNote");
            }
            sql = sql.Replace("@_@", tempprintReportsInfo.WhLoignID).Replace("@ORDER_ID", "'" + orderID + "'").ToString();
            return DBHelper.ExecuteDataSet(CommandType.Text, sql);
        }

        public DataSet GetPrintShippingOrderList(string orderID, PrintReportsInfo tempprintReportsInfo)
        {
            string sql = PublicMethod.GetInstance().GetPrintReportSQL(tempprintReportsInfo.OwnerID + "_AXPrintShippingOrderList");
            if (string.IsNullOrEmpty(sql))
            {
                sql = PublicMethod.GetInstance().GetPrintReportSQL("AXPrintShippingOrderList");
            }
            sql = sql.Replace("@_@", tempprintReportsInfo.WhLoignID).Replace("@ORDER_ID", "'" + orderID + "'").ToString();
            return DBHelper.ExecuteDataSet(CommandType.Text, sql);
        }
    }
}

